package edu.xlh.travel.service;

import com.alibaba.fastjson.JSONArray;
import com.alipay.api.AlipayApiException;
import edu.xlh.travel.common.Result;
import edu.xlh.travel.pojo.Orders;
import edu.xlh.travel.pojo.querypojo.QueryOrders;
import org.springframework.ui.Model;

import javax.servlet.http.HttpSession;
import java.util.HashMap;

public interface OrdersService {
    Result buy(HttpSession session, Orders orders);

    Result findAllOrders(HttpSession session);

    Result findAll();

    Result findAll(int page  , int size , HttpSession session);

    void updateStatusByOrderId(String status, String orderId);

    void updateStockByOrderId(String orderId , int stocks);

    Orders findById(String orderId);

    Result cancelOrder(String orderId, HttpSession session);

    Integer getOrderCount();

    String toPayOrderPage(String orderId, HttpSession session , Model model);

    String doPayForOrder(HashMap<String, String> orderInfo , HttpSession session) throws AlipayApiException;

    void updateOrderByEntitiy(Orders order);

    int countByUserId(String userId);

    Result QueryOrdersByCondition(Integer page, Integer limit, QueryOrders queryOrders, HttpSession session);

    Result deleteById(String id, HashMap hashMap, HttpSession session);

    Result batchDelete(JSONArray jsonArray, HttpSession session);

    Result consume(String orderId, HttpSession session);

    Result findByOrderId(String orderId, String emailId, HttpSession session);
}
